package com.jeesite.modules.demo.entity;

import javax.validation.Valid;
import javax.validation.constraints.Size;
import java.util.List;
import com.jeesite.common.collect.ListUtils;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * demo_customerEntity
 * @author ccz
 * @version 2025-03-19
 */
@Table(name="demo_customer", alias="a", label="demo_customer信息", columns={
		@Column(name="id", attrName="id", label="编号", isPK=true),
		@Column(name="create_by", attrName="createBy", label="创建人", isUpdate=false, isQuery=false),
		@Column(name="create_date", attrName="createDate", label="创建时间", isUpdate=false, isQuery=false),
		@Column(name="update_by", attrName="updateBy", label="修改人", isQuery=false),
		@Column(name="update_date", attrName="updateDate", label="修改时间", isQuery=false),
		@Column(name="remarks", attrName="remarks", label="备注信息", queryType=QueryType.LIKE),
		@Column(name="custname", attrName="custname", label="客户姓名"),
		@Column(name="custcode", attrName="custcode", label="客户编号"),
		@Column(name="sex", attrName="sex", label="性别"),
		@Column(name="phone", attrName="phone", label="电话"),
		@Column(name="del_flag", attrName="delFlag", label="删除标记"),
	}, orderBy="a.update_date DESC"
)
public class DemoCustomer extends DataEntity<DemoCustomer> {
	
	private static final long serialVersionUID = 1L;
	private String custname;		// 客户姓名
	private String custcode;		// 客户编号
	private String sex;		// 性别
	private String phone;		// 电话
	private String delFlag;		// 删除标记
	private List<DemoCustomerInfo> demoCustomerInfoList = ListUtils.newArrayList();		// 子表列表

	public DemoCustomer() {
		this(null);
	}
	
	public DemoCustomer(String id){
		super(id);
	}
	
	@Size(min=0, max=200, message="客户姓名长度不能超过 200 个字符")
	public String getCustname() {
		return custname;
	}

	public void setCustname(String custname) {
		this.custname = custname;
	}
	
	@Size(min=0, max=64, message="客户编号长度不能超过 64 个字符")
	public String getCustcode() {
		return custcode;
	}

	public void setCustcode(String custcode) {
		this.custcode = custcode;
	}
	
	@Size(min=0, max=1, message="性别长度不能超过 1 个字符")
	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}
	
	@Size(min=0, max=32, message="电话长度不能超过 32 个字符")
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	@Size(min=0, max=1, message="删除标记长度不能超过 1 个字符")
	public String getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(String delFlag) {
		this.delFlag = delFlag;
	}
	
	@Valid
	public List<DemoCustomerInfo> getDemoCustomerInfoList() {
		return demoCustomerInfoList;
	}

	public void setDemoCustomerInfoList(List<DemoCustomerInfo> demoCustomerInfoList) {
		this.demoCustomerInfoList = demoCustomerInfoList;
	}
	
}